<table class="table table-striped table-bordered table-checks media-table">
    <thead>
        <tr>
            <th class="actions-column">#</th>
            <th>User</th>
            <th>UserName</th>
            <th>Email</th>
            <th>Privilege</th>

        </tr>
    </thead>
    <tbody>
        <?php if (count($data['rows']) > 0) foreach ($data['rows'] as $row) { ?>
                <tr>
                    <td>
                        <?php
                        if ($_SESSION["auth"]["user"]->ause_position > $row->ause_position) {
                            ?>
                            <span style="padding: 0 4px"
                                  onclick="_SO.DeleteItem('<?php echo $row->ause_id ?>')"
                                  class="tip icon-trash" title="Delete User">
                            </span>
                            <span style="padding: 0 4px" 
                                  onclick="_SO.EditItem('<?php echo $row->ause_id ?>')" 
                                  class="tip icon-edit" title="Edit User">
                            </span>
                            <?php
                        }
                        ?>
                    </td>
                    <td><?php echo $row->ause_name ?></td>
                    <td><?php echo $row->ause_username ?></td>
                    <td><?php echo $row->ause_email ?></td>
                    <td><?php echo $row->ause_authority ?></td>

                </tr>
            <?php
            } else {
            
        }
        ?>
    </tbody>
</table>
<?php if ($data['totalpages'] > 1) {
    $pages = $data['totalpages'];
    ?>
    <br/>
    <div class="pagination pagination-centered">
        <ul>
            <?php if ($data['pagenum'] > 0) { ?>
                <li><span onclick="_REQUEST.LoadData(<?php echo $data['pagenum'] - 1 ?>)">Prev</span></li>
            <?php } ?>
            <?php for ($i = 0; $i < $data['totalpages']; $i++) { ?>
                <?php if ($i != $data['pagenum']) { ?>
                    <li><span onclick="_REQUEST.LoadData(<?php echo $i ?>)"><?php echo $i + 1 ?></span></li>
                        <?php } else { ?>
                    <li class="active"><span><?php echo $i + 1 ?></span></li>
                        <?php } ?>
            <?php } ?>
            <?php if ($data['pagenum'] + 1 < $data['totalpages']) { ?>
                <li><span onclick="_REQUEST.LoadData(<?php echo $data['pagenum'] + 1 ?>)">Next</span></li>
    <?php } ?>
        </ul>
    </div>
<?php } ?>